package com.zpark.se.wrapper_classes;

/**
 * Object类:
 */
public class ObjectDemo01 {
    public static void main(String[] args) throws CloneNotSupportedException {
        Object obj = new Object();
        // 获取当前类的字节码对象
        Class cls = obj.getClass();
        // 获取当前对象在内存当中的哈希码
        int code = obj.hashCode();
        // 比较两个对象内容是否相等
        boolean flag = obj.equals("obj");
        System.out.println(flag);

        boolean res1 = "zs".equals("OBJ");

        // 对象复制
        // Object clone = new ObjectDemo01().clone();
        System.out.println(new ObjectDemo01());
    }

    // 重写toString方法：作用是将对象的的属性以字符串的形式输出
    @Override
    public String toString() {
        return "ObjectDemo01{}";
    }

    @Override
    public int hashCode() {
        return super.hashCode();
    }

    @Override
    public boolean equals(Object obj) {
        return super.equals(obj);
    }
}
